﻿@using System.Security.Claims
@{
    ViewData["Title"] = "Home Page";
}

<div class="text-center">
    <h1 class="display-4">单点登录测试</h1>
    <p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
 @if (User?.Identity is { IsAuthenticated: true })
  {
    <h1>Welcome, @User.Identity.Name</h1><br />
    <p>
        @foreach (var claim in Context.User.Claims)
        {
            <div>@claim.Type: <b>@claim.Value</b></div>
    
            <br />
        }
    </p>
    <form asp-action="Logout" asp-controller="Account" method="post">
        <button class="btn btn-lg btn-danger" type="submit">退出登录</button>
    </form>
  }
else
{
    <a class="btn btn-lg btn-success" asp-controller="Account"
       asp-action="Login">去登录</a>
}
